#ifndef _XGATE_CFG_H
#define _XGATE_CFG_H
/*=========================== INCLUDES ================================*/

/* Core modules */
/* Configuration Options */
#include "common_cfg.h"
/* MCU derivative information */
#include __MCU_DERIVATIVE
/* Variable types and common definitions */
#include "stdint.h"
/* Common inlcudes*/
#include <hidef.h>

/* Used modules */
#include "xgate.h"

/*============================ MACROS =================================*/
#define SOFTWARE_TRIGGER_1			(uint8_t)( 0u )
#define SOFTWARE_TRIGGER_2			(uint8_t)( 1u )
#define SOFTWARE_TRIGGER_3			(uint8_t)( 2u )
#define SOFTWARE_TRIGGER_4			(uint8_t)( 3u )
#define SOFTWARE_TRIGGER_5			(uint8_t)( 4u )
#define SOFTWARE_TRIGGER_6			(uint8_t)( 5u )
#define SOFTWARE_TRIGGER_7			(uint8_t)( 6u )
#define SOFTWARE_TRIGGER_8			(uint8_t)( 7u )

#define SOFTWARE_TRIGGER_DISABLE	(uint8_t)( 0u )
#define SOFTWARE_TRIGGER_ENABLE		(uint8_t)( 1u )

/* XGATE FUTURE MACROS FOR SEMAPHORE */

#define ROUTE_INTERRUPT(vec_adr, cfdata)                \
  INT_CFADDR= (vec_adr) & 0xF0;                         \
  INT_CFDATA_ARR[((vec_adr) & 0x0F) >> 1]= (cfdata)

#define SOFTWARETRIGGER0_VEC  0x72 

/*=========================== TYPEDEFS ================================*/

/*========================== FUNCTIONS ================================*/
void XGATE_Init(void);

void XGATE_SW_TRIGGER(uint8_t TriggerNum, uint8_t TriggerMask);

#pragma CODE_SEG XGATE_CODE
	void XGATE_SW_TRIGGER_X(uint8_t TriggerNum, uint8_t TriggerMask);
#pragma CODE_SEG DEFAULT

#endif /* _XGATE_CFG_H */
